function* foo() {
    console.log('one')
    yield 1
    console.log('two')
    yield 2
    console.log('three')
    return 3
}

// const f = foo()
// f.next()
// f.next()
// f.next()
// f.next()

let p1 = new Promise((resolve, reject) => {
    resolve(4)
})

let p2 = new Promise((resolve, reject) => {
    reject(4)
})

Promise.all([p1, p2]).then(res => {console.log(res)})

// p.finally(() => {
//     console.log('end')
// }).then(res => {
//     // throw new Error('this is an error')
//     // console.log(res)
    
// }).then(res => {
//     console.log(res)
// })

// setTimeout(()=> {
//     console.log('set')
// }, 10)